﻿using System;
using System.Collections.Generic;
using System.Web;
using System.Web.Services;
using System.Web.SessionState;

namespace ExpertMIS
{
    /// <summary>
    /// Summary description for $codebehindclassname$
    /// </summary>
    [WebService(Namespace = "http://tempuri.org/")]
    [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
    public class LogoutAction : IHttpHandler, IRequiresSessionState
    {

        public void ProcessRequest(HttpContext context)
        {
            if (ExpertMIS.Codes.Utility.GetEnvironment().Logon)
            {
                ExpertMIS.Codes.Utility.GetEnvironment().DestroyCurrentSession();
            }
            context.Response.Redirect(context.Request.UrlReferrer.ToString());
            context.Response.End();
        }

        public bool IsReusable
        {
            get
            {
                return false;
            }
        }
    }
}
